package com.ale.oxetool.util;

import com.ale.oxetool.model.Phone;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * Created by wgs on 2016/4/2.
 */
@Component
public class Util {

    @Value("${oxeserver.oxe1.host}")
    private String oxe1Host;
    @Value("${oxeserver.oxe2.host}")
    private String oxe2Host;

    public boolean isSwitchDone(Phone phone, String targetPlatform) {
        return phone.getOxeServerAddr().equals(targetPlatform.replaceAll("^0+", "").equals("1") ? oxe1Host : oxe2Host);
    }

}
